package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GuiSecurityCodeMapper;
import com.ruoyi.system.domain.GuiSecurityCode;
import com.ruoyi.system.service.IGuiSecurityCodeService;

/**
 * 防伪码Service业务层处理
 *
 * @author wuhegui
 * @date 2024-01-06
 */
@Service
public class GuiSecurityCodeServiceImpl implements IGuiSecurityCodeService
{
    @Autowired
    private GuiSecurityCodeMapper guiSecurityCodeMapper;

    /**
     * 查询防伪码
     *
     * @param id 防伪码主键
     * @return 防伪码
     */
    @Override
    public GuiSecurityCode selectGuiSecurityCodeById(Long id)
    {
        return guiSecurityCodeMapper.selectGuiSecurityCodeById(id);
    }

    /**
     * 查询防伪码列表
     *
     * @param guiSecurityCode 防伪码
     * @return 防伪码
     */
    @Override
    public List<GuiSecurityCode> selectGuiSecurityCodeList(GuiSecurityCode guiSecurityCode)
    {
        return guiSecurityCodeMapper.selectGuiSecurityCodeList(guiSecurityCode);
    }

    /**
     * 新增防伪码
     *
     * @param guiSecurityCode 防伪码
     * @return 结果
     */
    @Override
    public int insertGuiSecurityCode(GuiSecurityCode guiSecurityCode)
    {
        guiSecurityCode.setCreateTime(DateUtils.getNowDate());
        return guiSecurityCodeMapper.insertGuiSecurityCode(guiSecurityCode);
    }

    /**
     * 修改防伪码
     *
     * @param guiSecurityCode 防伪码
     * @return 结果
     */
    @Override
    public int updateGuiSecurityCode(GuiSecurityCode guiSecurityCode)
    {
        guiSecurityCode.setUpdateTime(DateUtils.getNowDate());
        return guiSecurityCodeMapper.updateGuiSecurityCode(guiSecurityCode);
    }

    /**
     * 批量删除防伪码
     *
     * @param ids 需要删除的防伪码主键
     * @return 结果
     */
    @Override
    public int deleteGuiSecurityCodeByIds(Long[] ids)
    {
        return guiSecurityCodeMapper.deleteGuiSecurityCodeByIds(ids);
    }

    /**
     * 删除防伪码信息
     *
     * @param id 防伪码主键
     * @return 结果
     */
    @Override
    public int deleteGuiSecurityCodeById(Long id)
    {
        return guiSecurityCodeMapper.deleteGuiSecurityCodeById(id);
    }
}
